package cn.good.yan.feign.impl;

import cn.good.yan.feign.PaymentHystrixService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * 服务降级 - 处理逻辑
 * @author shengren.yan
 * @create 2023-12-28
 */
@Component
public class PaymentFallbackServiceImpl implements PaymentHystrixService {

    Logger log = LoggerFactory.getLogger(getClass());

    @Override
    public String paymentInfoOk(Integer id) {
        log.info("正常请求 - 服务端的接口 服务降级处理");
        return "====正常请求 fall back paymentInfoOk，o(╥﹏╥)o====";
    }

    @Override
    public String paymentInfoTimeOut(Integer id) {
        log.info("超时请求 - 服务端的接口 服务降级处理");
        return "====超时请求 fall back paymentInfoTimeOut，o(╥﹏╥)o====";
    }

    @Override
    public String circuit(Integer id) {
        log.info("id错误 - 服务端的接口 服务熔断处理");
        return "====服务熔断 fall back circuit，o(╥﹏╥)o====";
    }
}
